home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat2 / standard / getrlimit.z / getrlimit
Encoding:
Text File  |  1998-10-20  |  16.5 KB  |  263 lines

  1.  
  2.  
  3.  
  4. ggggeeeettttrrrrlllliiiimmmmiiiitttt((((2222))))                                                      ggggeeeettttrrrrlllliiiimmmmiiiitttt((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      getrlimit, getrlimit64, setrlimit, setrlimit64 - control maximum system
  10.      resource consumption
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////rrrreeeessssoooouuuurrrrcccceeee....hhhh>>>>
  14.  
  15.      iiiinnnntttt ggggeeeettttrrrrlllliiiimmmmiiiitttt((((iiiinnnntttt rrrreeeessssoooouuuurrrrcccceeee,,,, ssssttttrrrruuuucccctttt rrrrlllliiiimmmmiiiitttt ****rrrrllllpppp))));;;;
  16.  
  17.      iiiinnnntttt ggggeeeettttrrrrlllliiiimmmmiiiitttt66664444((((iiiinnnntttt rrrreeeessssoooouuuurrrrcccceeee,,,, ssssttttrrrruuuucccctttt rrrrlllliiiimmmmiiiitttt66664444 ****rrrrllllpppp))));;;;
  18.  
  19.      iiiinnnntttt sssseeeettttrrrrlllliiiimmmmiiiitttt((((iiiinnnntttt rrrreeeessssoooouuuurrrrcccceeee,,,, ccccoooonnnnsssstttt ssssttttrrrruuuucccctttt rrrrlllliiiimmmmiiiitttt ****rrrrllllpppp))));;;;
  20.  
  21.      iiiinnnntttt sssseeeettttrrrrlllliiiimmmmiiiitttt66664444((((iiiinnnntttt rrrreeeessssoooouuuurrrrcccceeee,,,, ccccoooonnnnsssstttt ssssttttrrrruuuucccctttt rrrrlllliiiimmmmiiiitttt66664444 ****rrrrllllpppp))));;;;
  22.  
  23. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  24.      Limits on the consumption of a variety of system resources by a process
  25.      and each process it creates may be obtained with _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt and set with
  26.      _ssss_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt.
  27.  
  28.      _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt_6666_4444 and _ssss_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt_6666_4444 allow 32-bit programs to set 64-bit limits.
  29.      This is particularly useful for shells and other 32-bit programs which
  30.      fork 64-bit binaries.  Unless otherwise specified, _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt_6666_4444 and
  31.      _ssss_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt_6666_4444 function in exactly the same manner as _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt and
  32.      _ssss_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt.
  33.  
  34.      Each call to either _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt or _ssss_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt identifies a specific resource
  35.      to be operated upon as well as a resource limit.  A resource limit is a
  36.      pair of values:  one specifying the current (soft) limit, the other a
  37.      maximum (hard) limit.  Soft limits may be changed by a process to any
  38.      value that is less than or equal to the hard limit.  A process may
  39.      (irreversibly) lower its hard limit to any value that is greater than or
  40.      equal to the soft limit.
  41.  
  42.      Only a the super-user can raise a hard limit.
  43.  
  44.      Both hard and soft limits can be changed in a single call to _ssss_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt
  45.      subject to the constraints described above.
  46.  
  47.      _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt_6666_4444 and _ssss_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt_6666_4444 are provided to allow 32 bit applications to
  48.      manipulate 64 bit limit values.  For example, the _RRRR_LLLL_IIII_MMMM_IIII_TTTT______FFFF_SSSS_IIII_ZZZZ_EEEE can be set
  49.      as large as 0xffffffffff with _ssss_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt_6666_4444 when using the xfs filesystem.
  50.  
  51.      When using the 32 bit interfaces, limits may have an infinite value of
  52.      _RRRR_LLLL_IIII_MMMM______IIII_NNNN_FFFF_IIII_NNNN_IIII_TTTT_YYYY (0x7fffffff).  In this case _r_l_p is a pointer to _s_t_r_u_c_t
  53.      _r_l_i_m_i_t that includes the following members:
  54.           _rrrr_llll_iiii_mmmm______tttt _rrrr_llll_iiii_mmmm______cccc_uuuu_rrrr_;;;; _////_**** _cccc_uuuu_rrrr_rrrr_eeee_nnnn_tttt _((((_ssss_oooo_ffff_tttt_)))) _llll_iiii_mmmm_iiii_tttt _****_////
  55.           _rrrr_llll_iiii_mmmm______tttt _rrrr_llll_iiii_mmmm______mmmm_aaaa_xxxx_;;;; _////_**** _hhhh_aaaa_rrrr_dddd _llll_iiii_mmmm_iiii_tttt _****_////
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                                                         PPPPaaaaggggeeee 1111
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68. ggggeeeettttrrrrlllliiiimmmmiiiitttt((((2222))))                                                      ggggeeeettttrrrrlllliiiimmmmiiiitttt((((2222))))
  69.  
  70.  
  71.  
  72.      _r_l_i_m__t is an arithmetic data type to which objects of type _i_n_t, _s_i_z_e__t,
  73.      and _o_f_f__t can be cast without loss of information.  Specifying the
  74.      _RRRR_LLLL_IIII_MMMM______IIII_NNNN_FFFF_IIII_NNNN_IIII_TTTT_YYYY value as the limit in a _ssss_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt call may allow the value
  75.      of the resource to exceed 0x7fffffff.  This is because specifying
  76.      _RRRR_LLLL_IIII_MMMM______IIII_NNNN_FFFF_IIII_NNNN_IIII_TTTT_YYYY as the limit indicates to the system to use no limit other
  77.      than that imposed by the operating system.  When _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt is used to
  78.      retrieve a limit which has a value greater than that which can be
  79.      represented by an _r_l_i_m__t, the value returned is the maximum value
  80.      representable by an _r_l_i_m__t.  This value is currently _UUUU_IIII_NNNN_TTTT______MMMM_AAAA_XXXX.
  81.  
  82.      When using the 64 bit interfaces, limits may have an infinite value of
  83.      _RRRR_LLLL_IIII_MMMM_6666_4444______IIII_NNNN_FFFF_IIII_NNNN_IIII_TTTT_YYYY (0x7fffffffffffffff).  In this case _r_l_p is a pointer to
  84.      _s_t_r_u_c_t _r_l_i_m_i_t_6_4 that includes the following members:
  85.           _rrrr_llll_iiii_mmmm_6666_4444______tttt         _rrrr_llll_iiii_mmmm______cccc_uuuu_rrrr_;;;;_////_**** _cccc_uuuu_rrrr_rrrr_eeee_nnnn_tttt _((((_ssss_oooo_ffff_tttt_)))) _llll_iiii_mmmm_iiii_tttt _****_////
  86.           _rrrr_llll_iiii_mmmm_6666_4444______tttt         _rrrr_llll_iiii_mmmm______mmmm_aaaa_xxxx_;;;;_////_**** _hhhh_aaaa_rrrr_dddd _llll_iiii_mmmm_iiii_tttt _****_////
  87.  
  88.      _r_l_i_m_6_4__t is an arithmetic data type to which objects of type _l_o_n_g _l_o_n_g
  89.      and _o_f_f_6_4__t can be cast without loss of information.
  90.  
  91.      The possible resources, their descriptions, and the actions taken when
  92.      current limit is exceeded, are summarized below:
  93.  
  94.      RRRRLLLLIIIIMMMMIIIITTTT____CCCCOOOORRRREEEE      The maximum size of a core file in bytes that may be
  95.                       created by a process.  A limit of _0 will prevent the
  96.                       creation of a core file.  The writing of a core file
  97.                       will terminate at this size.
  98.  
  99.      RRRRLLLLIIIIMMMMIIIITTTT____CCCCPPPPUUUU       The maximum amount of CPU time in seconds used by a
  100.                       process.  _SSSS_IIII_GGGG_XXXX_CCCC_PPPP_UUUU is sent to a process which exceeds
  101.                       this limit.  If the process is holding or ignoring
  102.                       _SSSS_IIII_GGGG_XXXX_CCCC_PPPP_UUUU, the behavior is scheduling class defined.
  103.                       Unless the _SSSS_VVVV_RRRR_4444______SSSS_IIII_GGGG_NNNN_AAAA_LLLL_SSSS variable in _////_eeee_tttt_cccc_////_dddd_eeee_ffff_aaaa_uuuu_llll_tttt_////_llll_oooo_gggg_iiii_nnnn
  104.                       is set to NO, this signal will be ignored by default.
  105.  
  106.      RRRRLLLLIIIIMMMMIIIITTTT____DDDDAAAATTTTAAAA      The maximum size of a process's heap in bytes.  A _bbbb_rrrr_kkkk(2)
  107.                       which attempts to exceed this limit will fail with errno
  108.                       set to _EEEE_NNNN_OOOO_MMMM_EEEE_MMMM.
  109.  
  110.      RRRRLLLLIIIIMMMMIIIITTTT____FFFFSSSSIIIIZZZZEEEE     The maximum size of a file in bytes that may be created
  111.                       by a process.  A limit of _0 will prevent the creation of
  112.                       a file.  A process which attempts to exceed this limit
  113.                       will fail with errno set to _SSSS_IIII_GGGG_XXXX_FFFF_SSSS_ZZZZ.  If the process is
  114.                       holding or ignoring _SSSS_IIII_GGGG_XXXX_FFFF_SSSS_ZZZZ, continued attempts to
  115.                       increase the size of a file beyond the limit will fail
  116.                       with errno set to _EEEE_FFFF_BBBB_IIII_GGGG.  Unless the _SSSS_VVVV_RRRR_4444______SSSS_IIII_GGGG_NNNN_AAAA_LLLL_SSSS
  117.                       variable in _////_eeee_tttt_cccc_////_dddd_eeee_ffff_aaaa_uuuu_llll_tttt_////_llll_oooo_gggg_iiii_nnnn is set to NO, this signal
  118.                       will be ignored by default.
  119.  
  120.      RRRRLLLLIIIIMMMMIIIITTTT____NNNNOOOOFFFFIIIILLLLEEEE    The maximum number of open file descriptors that the
  121.                       process can have.  Functions that attempt to create new
  122.                       file descriptors beyond this limit will fail with errno
  123.                       set to _EEEE_MMMM_FFFF_IIII_LLLL_EEEE.
  124.  
  125.  
  126.                                                                         PPPPaaaaggggeeee 2222
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133. ggggeeeettttrrrrlllliiiimmmmiiiitttt((((2222))))                                                      ggggeeeettttrrrrlllliiiimmmmiiiitttt((((2222))))
  134.  
  135.  
  136.  
  137.      RRRRLLLLIIIIMMMMIIIITTTT____SSSSTTTTAAAACCCCKKKK     The maximum size of a process's stack in bytes.  _SSSS_IIII_GGGG_SSSS_EEEE_GGGG_VVVV
  138.                       is sent to a process which attempts to exceed this
  139.                       limit.  If the process is holding or ignoring _SSSS_IIII_GGGG_SSSS_EEEE_GGGG_VVVV,
  140.                       or is catching _SSSS_IIII_GGGG_SSSS_EEEE_GGGG_VVVV and has not made arrangements to
  141.                       use an alternate stack [see _ssss_iiii_gggg_aaaa_llll_tttt_ssss_tttt_aaaa_cccc_kkkk(2)], the
  142.                       disposition of _SSSS_IIII_GGGG_SSSS_EEEE_GGGG_VVVV will be set to _SSSS_IIII_GGGG______DDDD_FFFF_LLLL before it
  143.                       is sent.  This value is used as the default stacksize by
  144.                       _ssss_pppp_rrrr_oooo_cccc(2).
  145.  
  146.      RRRRLLLLIIIIMMMMIIIITTTT____VVVVMMMMEEEEMMMM      The maximum size of a process's mapped address space in
  147.                       bytes.  _bbbb_rrrr_kkkk(2) and _mmmm_mmmm_aaaa_pppp(2) functions which attempt to
  148.                       exceed this limit will fail with errno set to _EEEE_NNNN_OOOO_MMMM_EEEE_MMMM.
  149.                       In addition, the automatic stack growth will fail with
  150.                       the effects outlined above.
  151.  
  152.      RRRRLLLLIIIIMMMMIIIITTTT____RRRRSSSSSSSS       The maximum size, in bytes to which a process's resident
  153.                       set size may grow.  This imposes a limit on the amount
  154.                       of physical memory to be given to a process; if memory
  155.                       is tight, the system will prefer to take memory from
  156.                       processes that are exceeding their declared resident set
  157.                       size.
  158.  
  159.      RRRRLLLLIIIIMMMMIIIITTTT____PPPPTTTTHHHHRRRREEEEAAAADDDD   The maximum number of threads (_pppp_tttt_hhhh_rrrr_eeee_aaaa_dddd_ssss(5)) that a
  160.                       process may create.  Functions that attempt to create
  161.                       new threads beyond this limit will fail with the error
  162.                       _EEEE_AAAA_GGGG_AAAA_IIII_NNNN.
  163.  
  164.      Because limit information is stored in the per-process information, the
  165.      shell builtin _uuuu_llll_iiii_mmmm_iiii_tttt must directly execute this system call if it is to
  166.      affect all future processes created by the shell; limit is thus a built-
  167.      in command to _ssss_hhhh_((((_1111_)))) and _cccc_ssss_hhhh_((((_1111_)))).
  168.  
  169.      The value of the current limit of the following resources affect these
  170.      implementation defined constants:
  171.                   Limit           Implementation Defined Constant
  172.                   _______________________________________________
  173.                   RLIMIT_NOFILE   OPEN_MAX
  174.  
  175. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  176.      Upon successful completion, the function _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt returns a value of _0;
  177.      otherwise, it returns a value of -_1 and sets _e_r_r_n_o to indicate an error.
  178.  
  179. EEEERRRRRRRROOOORRRRSSSS
  180.      Under the following conditions, the functions _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt and _ssss_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt
  181.      fail and set _e_r_r_n_o to:
  182.  
  183.      [EFAULT]       The address specified for _r_l_p in invalid.
  184.  
  185.      [EINVAL]       if an invalid _r_e_s_o_u_r_c_e was specified; or in a _ssss_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt
  186.                     call, the new _r_l_i_m__c_u_r exceeds the new _r_l_i_m__m_a_x.
  187.  
  188.  
  189.  
  190.  
  191.  
  192.                                                                         PPPPaaaaggggeeee 3333
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199. ggggeeeettttrrrrlllliiiimmmmiiiitttt((((2222))))                                                      ggggeeeettttrrrrlllliiiimmmmiiiitttt((((2222))))
  200.  
  201.  
  202.  
  203.      [EPERM]        if the limit specified to _ssss_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt would have raised the
  204.                     maximum limit value and the caller is not the super-user.
  205.  
  206. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  207.      csh(1), sh(1), open(2), sigaltstack(2), malloc(3C), signal(5).
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.                                                                         PPPPaaaaggggeeee 4444
  259.  
  260.  
  261.  
  262.